package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"time"
)

const N int = 200005
const MOD int64 = 998244353

var sed [N]int64
var a, b [N]int64

func init() {
	sed[0] = 1
	for i := 1; i < N; i++ {
		sed[i] = (sed[i-1]*time.Now().Unix()%MOD + time.Now().Unix()) % MOD
	}
}

type tree struct {
	l, r         int
	a, b         int64
	lazya, lazyb int64
}

var tr [N << 2]tree

func build(p int, l int, r int) {
	tr[p].l = l
	tr[p].r = r
	if l == r {
		tr[p].a = int64(a[l])
		tr[p].b = int64(b[l])
		return
	}
	var mid int = (l + r) / 2
	build(p*2, l, mid)
	build(p*2+1, mid+1, r)
	tr[p].a = tr[p*2].a + tr[p*2+1].a
	tr[p].b = tr[p*2].b + tr[p*2+1].b
}
func pushDown(p int) {
	if tr[p].lazyb > 0 {
		tr[p*2].b = tr[p].lazyb * int64(tr[p*2].r-tr[p*2].l+1)
		tr[p*2+1].b = tr[p].lazyb * int64(tr[p*2+1].r-tr[p*2+1].l+1)
		tr[p*2].lazyb = tr[p].lazyb
		tr[p].lazyb = 0
	}
	if tr[p].lazya > 0 {
		tr[p*2].a = tr[p].lazya * int64(tr[p*2].r-tr[p*2].l+1)
		tr[p*2+1].a = tr[p].lazya * int64(tr[p*2+1].r-tr[p*2+1].l+1)
		tr[p*2].lazya = tr[p].lazya
		tr[p].lazya = 0
	}
}
func update(p int, l int, r int, tp int, val int64) {
	if l <= tr[p].l && r >= tr[p].r {
		if tp == 0 {
			tr[p].a = int64(tr[p].r-tr[p].l+1) * val
			tr[p].lazya = val
		} else {
			tr[p].b = int64(tr[p].r-tr[p].l+1) * val
			tr[p].lazyb = val
		}
		return
	}
	pushDown(p)
	var mid int = (tr[p].l + tr[p].r) / 2
	if r >= mid+1 {
		update(p*2+1, l, r, tp, val)
	}
	if l <= mid {
		update(p*2, l, r, tp, val)
	}
	tr[p].a = tr[p*2].a + tr[p*2+1].a
	tr[p].b = tr[p*2].b + tr[p*2+1].b
}
func querySum(p int, l int, r int, tp int) int64 {
	if l <= tr[p].l && r >= tr[p].r {
		if tp == 0 {
			return tr[p].a
		}
		return tr[p].b
	}
	pushDown(p)
	var mid int = (tr[p].l + tr[p].r) / 2
	var sum int64
	if r >= mid+1 {
		sum = sum + querySum(p*2+1, l, r, tp)
	}
	if l <= mid {
		sum = sum + querySum(p*2, l, r, tp)
	}
	return sum
}

func main() {
	var n, m int
	reader := bufio.NewScanner(os.Stdin)
	reader.Split(bufio.ScanWords)
	for reader.Scan() {
		println(reader.Text())
	}
	fmt.Println(reader)
	if reader.Scan() {n, _ =strconv.Atoi(reader.Text())}
	if()
	fmt.Scan(&n, &m)
	for i := 1; i <= n; i++ {
		fmt.Scan(&a[i])
		a[i] = sed[a[i]]
	}
	for i := 1; i <= n; i++ {
		fmt.Scan(&b[i])
		b[i] = sed[b[i]]
	}
	build(1, 1, n)
	var op, l, r, x, l1, r1 int
	for i := 1; i <= m; i++ {
		fmt.Scan(&op)
		if op == 1 {
			fmt.Scan(&l, &r, &l1, &r1)
			if querySum(1, l, r, 0) == querySum(1, l1, r1, 1) {
				fmt.Println("Yes")
			} else {
				fmt.Println("No")
			}
		} else if op == 2 {
			fmt.Scan(&l, &r, &x)
			update(1, 1, n, 0, sed[x])
		} else {
			fmt.Scan(&l, &r, &x)
			update(1, 1, n, 1, sed[x])
		}
	}

}
